 <template>
 	<el-dialog title="" visible :show-close="false" append-to-body :modal-append-to-body="false" class="wrap" size="small">
 		<div class="bt">学生详情</div>
		<i class="el-icon-close close" @click="cancel" style="color: white;z-index:10;"></i>
 		<el-form label-width="100px" class="form">
 			
 			<el-tabs v-model="activeName" @tab-click="handleClick" style="text-align: center;">
			    <el-tab-pane label="基本信息" name="first">
			    <el-form-item label="学生姓名">
 				<el-input v-model="form.zwm" :readonly='true'  class="select-block"></el-input>
 			    </el-form-item>
 			    
 			    <el-form-item label="性别">
 				<el-input v-model="form.xb" :readonly='true'  class="select-block"></el-input>
 			    </el-form-item>
 			    
 			    <el-form-item label="电话">
 				<el-input v-model="form.dh" :readonly='true'  class="select-block"></el-input>
 			    </el-form-item>
 			    
 			    <el-form-item label="出生日期">
 				<el-input v-model="form.csrq" :readonly='true'  class="select-block"></el-input>
 			    </el-form-item>
			    </el-tab-pane>
			    
			    
			    <el-tab-pane label="考勤" name="second">
			      <el-table :data="kqdataList" stripe style="width: 100%">
					<el-table-column prop="bjmc" label="班级名称"></el-table-column>
					<el-table-column prop="sj" label="考勤时间"></el-table-column>
					<el-table-column prop="zt" label="考勤状态"></el-table-column>
					<el-table-column prop="lsmc" label="考勤老师"></el-table-column>
				  </el-table>
			    </el-tab-pane>
			    
			    <el-tab-pane label="考试成绩" name="third">
			      <el-table :data="kqdataList" stripe style="width: 100%">
					<el-table-column prop="kslx" label="考试类型"></el-table-column>
					<el-table-column prop="score" label="分数"></el-table-column>
					<el-table-column prop="crtime" label="第一次输入时间"></el-table-column>
					<el-table-column prop="uptime" label="最后一次修改时间"></el-table-column>
				  </el-table>
			    </el-tab-pane>
			    
			    
			    <el-tab-pane label="作业分数" name="fourth">
			      <el-table :data="kqdataList" stripe style="width: 100%">
					<el-table-column prop="zylx" label="作业类型"></el-table-column>
					<el-table-column prop="score" label="分数"></el-table-column>
					<el-table-column prop="crtime" label="作业录入日期"></el-table-column>
				  </el-table>
			    </el-tab-pane>
			    
			    
			    <el-tab-pane label="学生评价" name="fiveth">
			      <el-table :data="kqdataList" stripe style="width: 100%">
					<el-table-column prop="pjlx" label="评价类型"></el-table-column>
					<el-table-column prop="pjms" label="评价描述"></el-table-column>
					<el-table-column prop="sj" label="评价时间"></el-table-column>
					<el-table-column prop="jqmc" label="加强描述"></el-table-column>
					<el-table-column prop="jqnotes" label="加强文字描述部分"></el-table-column>
				  </el-table>
			    </el-tab-pane>
            </el-tabs>
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 			<!--<el-form-item label="中文名">
 				<el-input v-model="form.zwm" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="英文名">
 				<el-input v-model="form.ywm" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="性别">
 				<el-input v-model="form.xb" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="电话">
 				<el-input v-model="form.dh" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="是否启用">
 				<el-input v-model="form.isqymc" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="出生日期">
 				<el-input v-model="form.csrq" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="招生来源">
 				<el-input v-model="form.zsly" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="父母手机号">
 				<el-input v-model="form.fmdh" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="微信号">
 				<el-input v-model="form.wx" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="家庭地址">
 				<el-input v-model="form.jtdz" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="公立学校">
 				<el-input v-model="form.glxx" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="年级班级">
 				<el-input v-model="form.njbj" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="学号">
 				<el-input v-model="form.xh" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>
 			<el-form-item label="账号余额">
 				<el-input v-model="form.yuer" :readonly='true'  class="select-block"></el-input>
 			</el-form-item>-->
 		</el-form>
 		<el-button type="primary" class="submit" @click="submit">确定</el-button>
 	</el-dialog>
 </template>
 <script type="text/javascript">
 	import qs from 'qs'
 	export default {
 		props: ['params'],
 		data() {
 			return {
 				 activeName: 'first',
 				form: {
					 dh :'',
					 mm :'',
					 tx :'',
					 xb :'',
					 zwm :'',
					 ywm :'',
					 lsid :'',
					 bjid :'',
					 isty :'',
					 iszf :'',
					 issj :'',
					 isqymc:'',
					 lx :'',
					 csrq :'',
					 zsly :'',
					 fmdh :'',
					 wx :'',
					 jtdz :'',
					 glxx :'',
					 njbj :'',
					 bj :'',
					 xh :'',
					 yuer :'',
 					 id:''
 				},
 				kqdataList: [],
 			}
 		},
 		created() {
  		 this.form.id = this.params.row.xsid;
          this.loadinfo();
          this.kq();
 		},
 		methods: {
 			handleClick(tab, event) {
            console.log(tab, event);
       },
       //考勤
          kq() {
				var logininfo = JSON.parse(localStorage.logininfo);
				  this.axios.get(this.$store.state.api + 'xs/xiangqing', {
					params: {
						xsid:this.params.row.xsid,
						zt:'1'
					}
				}).then(res => {
					console.log(res)
					let data = res.data.data;
						let list = data.list;
						this.kqdataList = list;
					this.searchLoading = false;
				}).catch(res => {
					console.log(res)
					this.searchLoading = false;
				})

			},
 			loadinfo(){
 				 var logininfo = JSON.parse(localStorage.logininfo) ;
 				 this.axios.get(this.$store.state.api+'xs/info',{
 						 params:{
 							 xxid:logininfo.xxid,
 							 yhid:logininfo.id,
 							 id:this.form.id
 						 }
 					}).then( res =>  {
 							this.form=res.data.data
 					 }).catch(res => {
 						this.$message.warning("服务器异常");
 			 				this.$emit('close', { type: 'xxxq', cancel: true });
 					 })
 			},
 			 submit() {
 				//检测
 				this.$store.state.loading = true;
 				/*if(!this.form.id) {
 					this.$message.warning('请填写分类');
 					this.$store.state.loading = false;
 					return;
 				}*/
 				//装载数据
 				var logininfo = JSON.parse(localStorage.logininfo);
 				var params2 = qs.stringify({
 						id: this.form.id,
 						yhid: logininfo.id,
 						xxid: logininfo.xxid
 					})
 				//执行
 				    this.axios.post(this.$store.state.api + 'xs/info',  params2 )
 						.then(res => {
 							if(res.data.code == 1) {
 								this.$emit('close', { type: 'xxxq', cancel: false });
 								this.$store.state.loading = false;
 							} else {
 								this.$emit('close', { type: 'xxxq', cancel: false });
 								this.$store.state.loading = false;
 							}
 						}).catch(res => {
 							this.$message.warning("服务器异常");
 							this.$store.state.loading = false;
 						})
 			},
 			cancel() {
 				this.$emit('close', { type: 'xxxq', cancel: true })
 			}
 		}
 	}
 </script>
 <style lang="less" scoped>
 	.wrap {
 		text-align: center;
 	}
 	.form {
 		text-align: left;
 		margin-top: 10px;
 	}
 	.bt{
		 position: absolute;
     width: 100%;
     height: 50px;
     margin: 0 auto;
     top: 0;
     left: 0;
     background: #50BFFF;
     color:white;
     text-align:left;
     line-height: 50px;
     font-size: 17px;
     padding-left: 15px;
		}
 	.input {
             width: 300px;
             display: inline-block;
         }
 	.select-block {
 		display: block;
 	}
 	.submit {
 		width: 120px;
 	}
 	.header{
 		width: 100%;
 		height: 30px;
 		margin: 0 auto;
 	}
 	.one{
 		width: 25%;
 		height: 30px;
 		float: left;
 		text-align: center;
 		line-height: 30px;
 	}
 </style>
